<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>案例：模板语法</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>

    <div id="root">
        <h2>插值语法</h2>
        <p>你好，{{ name }}</p>

        <hr />

        <h2>指令语法</h2>
        <!-- v-bind 完整写法 -->
        <a v-bind:href="url.baidu" target="_blank">点我去百度</a>
        <!-- v-bind 简写形式 -->
        <a :href="url.taobao" target="_blank">点我去淘宝</a>
    </div>

    <script>
        new Vue({
            el: '#root',
            data: {
                name: '张三',
                url: {
                    baidu: 'https://www.baidu.com/',
                    taobao: 'https://www.taobao.com/'
                }
            }
        })
    </script>

</body>
</html>